<template>
  <div class="Rinking">
    <div v-for="(v,i) in personTypeLists" :key="i" class="Rinking-item">
      <div class="RinkName">
        <span style="font-size:0.75rem">{{v.dutyName}}</span>
        <span class="num">{{v.dutyNum}}<span style="font-size:0.75rem;color:#D8D8D8">人</span></span>
      </div>
      <div :class="customColorMethod(i)">
        <el-progress :percentage="v.proportion" :show-text="false" stroke-linecap="roud " :stroke-width='3' ></el-progress>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      obj: [
        {
          num: 1,
          name: '掘进工',
          number: 87,
          percentage: 87
        },
        {
          num: 2,
          name: '巷道维修工',
          number: 66,
          percentage: 66
        },
        {
          num: 3,
          name: '液压系统检修工',
          number: 43,
          percentage: 43
        },
        {
          num: 4,
          name: '瓦斯抽放工',
          number: 42,
          percentage: 42
        },
        {
          num: 5,
          name: '综采三机维修工',
          number: 41,
          percentage: 41
        }
      ]
    };
  },
  props: {
    personTypeLists: {
      typeof: Array,
      default: () => []
    }
  },
  computed: {
    customColorMethod() {
      return function(percentage) {
        let className = '';
        if (percentage > 1) {
          className = 'before-2';
        } else {
          className = 'before-1';
        }
        return className;
      };
    }
  }
};
</script>

<style lang="scss" scoped>
.Rinking{
  width: 100%;
  height: 8.75rem;
  box-sizing: border-box;
  .RinkName{
    display: flex;
    justify-content: space-between;
    margin-bottom: .5rem;
    height: .8125rem;
    span{
      font-size: .875rem;
      color: #D9D9D9;
      .simple{
        color: #8E8E8E;
        font-family: Helvetica-bold;
        font-weight: 700;
        &.top{
          color: #F4BE2D;
          font-family: Helvetica-bold;
        }
      }
    }
  }
    .before-1 {
      .el-progress{
        margin-bottom: .375rem;
        ::v-deep .el-progress-bar__inner{
          width:100%;
          background-image:linear-gradient(to right,#01ffff,#0092fb)
        }
      }
    }
    .before-2 {
      .el-progress{
        margin-bottom: .375rem;
        ::v-deep .el-progress-bar__inner{
          width:100%;
          background-image:linear-gradient(to right,#f2f5f6,#30f6f6)
        }
      }
    }
  .num{
    color: #FFFFFF !important;
  }
}
</style>
